package com.lepu.app.fun.my.bean;

import java.io.Serializable;
import java.util.ArrayList;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.lepu.app.fun.knowledge.bean.Article;

public class BeanSearchResult implements Serializable {

	private static final long serialVersionUID = 8296257066916405589L;
	
	public ArrayList<Article> ArticleList;
	public ArrayList<BeanQuestionAnswer> QuestionList;
	
	public static BeanSearchResult parseJsonData(String dataString) {
		String result = "";
		try {
			JSONObject jsonObject = new JSONObject(dataString);
			JSONObject obj1 = (JSONObject) jsonObject.get("Result");
			JSONObject obj2 = obj1.getJSONObject("DetailInfo");
			
			result = obj2.toString();
		} catch (JSONException e) {
			e.printStackTrace();
		}

		Gson gson = new Gson();
		BeanSearchResult item = gson.fromJson(result,
				new TypeToken<BeanSearchResult>() {
				}.getType());
		return item;
	}
}
